import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.nio.IntBuffer;
import java.util.zip.Inflater;

import javax.swing.JButton;
import javax.swing.JPanel;

import org.json.JSONException;


public class ButtonPanel extends JPanel 
{
	static DMserver server;
	public ButtonPanel(final DMserver server)
	{
		GridLayout layout = new GridLayout(4,2);
		JButton btnNewPlayer = new JButton("newPlayer");
		JButton btnEndTurn = new JButton("endTurn");
		
		
		
		setLayout(layout);
		add(btnNewPlayer);
		add(btnEndTurn);
		
		
		btnEndTurn.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent arg0) 
			{
				try {server.endTurn();} 
				catch (IOException e){e.printStackTrace();}
			}
		});
		
		btnNewPlayer.addActionListener(new ActionListener()
		{

			@Override
			public void actionPerformed(ActionEvent arg0) 
			{
				try {server.newPlayer();}
				catch (IOException e) {e.printStackTrace();}
			}	
		});
		
		
		
	}
}
